/**=========================================================
 * Service: DialogUtils.js
 =========================================================*/

App.service('DialogUtils', ['ngDialog',
    function(ngDialog) {
        'use strict';        
        return {
            alert: function(content) {
                ngDialog.openConfirm({
                    plain: true,
                    template: '\
                        <p>' + content + '</p>\
                        <div class="ngdialog-buttons">\
                            <button type="button" class="ngdialog-button ngdialog-button-primary" ng-click="closeThisDialog()">确定</button>\
                        </div>'
                });
            },
            confirm: function(content,confirmFn,cancelFn) {
                ngDialog.openConfirm({
                plain: true,
                template: '\
                        <p>' + content + '</p>\
                        <div class="ngdialog-buttons">\
                            <button type="button" class="ngdialog-button ngdialog-button-secondary" ng-click="closeThisDialog()">取消</button>\
                            <button type="button" class="ngdialog-button ngdialog-button-primary" ng-click="confirm()">继续</button>\
                        </div>'
                }).then(confirmFn,cancelFn);
            }
        };
    }
]);